<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*"  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="kind/themes/default/default.css" />
	<link rel="stylesheet" href="kind/plugins/code/prettify.css" />
  </head>
  
  <body>
   	<%@ include file="top.jsp" %>
  
   	<div class="container">
		<div class="row">
			<div class="span3">
				<div class="well" style="padding: 8px 0;margin-top:60px;" >
					<ul class="nav nav-list">
						<li class="nav-header">${sessionScope.pu.project.name }</li>
						<li>${sessionScope.user.username }:${sessionScope.pu.role }</li>
						<li class="divider"></li>
						<li><a href="project.jspx?id=${sessionScope.pu.projectid }"><i class="icon-home"></i>最新动态</a></li>
						<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
						<li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
						<li ><a href="file.jspx"><i class="icon-file"></i>文件共享</a></li>
						<li class="active"><a href="contact.jspx"><i class="icon-user icon-white"></i>联系人</a></li>
						<li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
						<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
						<li><a href="main.jspx?m=editProject&id=${pu.projectid }"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
				
				
				
				
				
			</div>
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:60px">
					<li class="active">
						<a href="contact.jspx"><i class="icon-user"></i>联系人</a>
					</li>
				</ul>
				<div class="well" style="border-radius:0px;border-top:none;position:relative;">
					
					<address >
						
						<h3>${requestScope.contact.name }</h3>
						<p>${requestScope.contact.company }</p>
						<small>手机:${requestScope.contact.moblie }</small><br />
						<small>固话:${requestScope.contact.tel }</small><br /><br/>
						<small>邮箱:${requestScope.contact.email }</small><br/>
						<small>地址:${requestScope.contact.address }</small> <br/><br/>
						<small>主页:<a href="${requestScope.contact.web }">${requestScope.contact.web }</a></small> <br/>
						<small>微博:<a href="${requestScope.contact.weibo }">${requestScope.contact.web }</a></small> <br/><br/>
					</address>
					<div class="line">记录</div>
					<hr style="margin:2px "/>
					<form   action="contact.jspx?m=newnote&cid=${requestScope.contact.id}" method="post" id="myform">
						<textarea class="span8" rows="3" name="cont" id="cont"></textarea><span id="note" style="color:red;font:24px;"></span>
						<br/>
						<button  class="btn primary-btn" id="btn">发布</button>
					</form >
					<c:forEach items="${requestScope.notelist}"  var="note">
					<blockquote>
						${note.cont}
						<small>${note.user.username }发布于 ${note.time}</small>
					</blockquote>
					</c:forEach>
					
					<a href="contact.jspx">←返回联系人列表</a>
				</div>			
			</div>
		</div>
	</div>
	<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
	<script charset="utf-8" src="kind/kindeditor.js"></script>
	<script charset="utf-8" src="kind/lang/zh_CN.js"></script>
	<script charset="utf-8" src=".kind/plugins/code/prettify.js"></script>
	<script>
		$(document).ready(function(){
			$("#btn").click(function(){
				$("#cont").text("");
			
			});
			
		
		
		function validate(){
			var note=$("#cont").val();
			if(note.trim().length==0){
				return false;
			}return true;
		};
		
		$("#cont").blur(function(){
			var cont=$("#cont").val();
				
			if(cont.trim().length==0){
				$("#note").html("不为空");
			}else{
				$("#note").html("√");
			}
		
		});
		
			
		$("#btn").click = function (){	
				$("#cont").text("");
  				
			//通过button按钮来提及表单
			if(validate()) {
				$("#myform").submit();
			} else {
			//若果上述条件不成立则不能提交表单button
				$("#myfrom").button();
			}		
		};
		
		});
		
		
			
	</script>
	
  </body>
</html>

<%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>

